package com.sw.resultinfo;

/**
 * 返回码枚举类
 * 同一类型的状态码区间为0-99
 * @Author howfree
 * @Date 2020/6/29 16:34
 */
public enum StatusCode {
    //基础返回码
    SUCCESS(0, "操作成功"),
    FAILED(1, "操作失败"),
    ERROR(2, "内部错误"),

    //公共返回码
    COMMON_REPEAT_REQUEST(1001,"重复请求"),
    NEED_LOGIN(1002, "需要登录"),

    //注册用户异常返回码
    REGISTER_NAME_VERIFICATION_FAILURE(1101,"用户名校验失败"),
    REGISTER_NAME_EXISTS(1102,"用户名已存在"),
    REGISTER_NAME_SENSITIVE_WORDS(1103,"用户名包含敏感词"),
    REGISTER_NAME_SPECIAL_CHARACTERS(1104,"用户名包含特殊字符"),



    //账号异常返回码
    ACCOUNT_LOGIN_EXCEPTION(1201,"用户登陆异常"),
    ACCOUNT_NOT_EXIST(1202,"用户账户不存在"),
    ACCOUNT_FROZEN(1203,"用户账户被冻结"),
    ACCOUNT_INVALID(1204,"用户账户已作废"),
    ACCOUNT_EXPIRED(1205,"用户登陆已过期"),
    ACCOUNT_PASSWORD_ERROR(1206,"用户密码错误"),
    ACCOUNT_PASSWORD_ENTERED_OVER(1207,"用户输入密码次数超限"),


    //内容违规异常返回码
    CONTENT_ILLEGAL_USER_INPUT(1301,"用户输入内容非法"),
    CONTENT_SENSITIVE_WORDS(1302,"内容包含违禁敏感词"),
    CONTENT_IMG_PROHIBITED_INFORMATION(1303,"图片包含违禁信息"),




    //支付异常返回码
    PAYMENT_TIMEOUT(1401,"支付超时"),
    PAYMENT_BALANCE_NOT_ENOUGH(1402,"账户余额不足"),

    //验证异常返回码
    VERIFICATION_PASSWORD_FAILURE(1501,"密码校验失败"),
    VERIFICATION_CERTIFICATE_TYPE_NOT_SELECTED(1502,"用户证件类型未选择"),
    VERIFICATION_PASSWORD_TOO_SHORT(1503,"密码长度不够"),
    VERIFICATION_INSUFFICIENT_PASSWORD_STRENGTH(1504,"密码强度不够"),
    VERIFICATION_CHECK_CODE_ERROR(1505,"校验码输入错误"),
    VERIFICATION_SMS_CHECK_CODE_ERROR(1506,"短信校验码输入错误"),
    VERIFICATION_EMAIL_CHECK_CODE_ERROR(1507,"邮件校验码输入错误"),
    VERIFICATION_USER_CHECK_CODE_ERROR(1508,"用户验证码错误"),
    VERIFICATION_USER_CHECK_CODE_TIME_OVER(1509,"用户验证码尝试次数超限"),
    VERIFICATION_USER_IDENTITY_FAILURE(1510,"用户身份校验失败"),
    VERIFICATION_USER_BASE_INFO_FAILURE(1511,"用户基本信息校验失败"),

    //格式异常返回码
    FORMAT_ID_NUMBER_ILLEGAL(1601,"大陆身份证格式错误"),
    FORMAT_MOBILE_PHONE_ERROR(1602,"手机格式错误"),
    FORMAT_ADDRESS_ERROR(1603,"地址格式错误"),
    FORMAT_EMAIL_ERROR(1604,"邮箱格式错误"),

    //文件异常返回码
    FILE_USER_UPLOAD_EXCEPTION(1701,"用户上传文件异常"),
    FILE_TYPE_MISMATCH(1702,"用户上传文件类型不匹配"),
    FILE_SIZE_TOO_LARGE(1703,"用户上传文件太大"),
    FILE_IMG_SIZE_TOO_LARGE(1704,"用户上传图片太大"),
    FILE_VIDEO_SIZE_TOO_LARGE(1705,"用户上传视频太大"),

    //权限异常返回码
    AUTHORITY_ACCESS_EXCEPTION(1801,"访问权限异常"),
    AUTHORITY_UNAUTHORIZED_ACCESS(1802,"访问未授权"),
    AUTHORITY_IN_PROGRESS(1803,"正在授权中"),
    AUTHORITY_APPLICATION_REJECTED(1804,"用户授权申请被拒绝"),

    //传入的参数异常返回码
    PARAMETER_USER_REQUEST_ERROR(1901,"用户请求参数错误"),
    PARAMETER_IS_EMPTY(1902,"请求必填参数为空"),
    PARAMETER_OVER_RANGE(1903,"请求参数值超出允许的范围"),
    PARAMETER_FORMAT_MISMATCH(1904,"参数格式不匹配"),
    PARAMETER_ORDER_NO_IS_EMPTY(1905,"订单号为空"),
    PARAMETER_AMOUNT_OVER_LIMIT(1906,"金额超出限制"),
    PARAMETER_QUANTITY_OVER_LIMIT(1907,"数量超出限制"),
    PARAMETER_JSON_PARSE_FAILURE(1908,"请求JSON解析失败");

    private int code;
    private String desc;

    StatusCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }}
